IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[xz_Mailings_DeleteMailing]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [xz_Mailings_DeleteMailing]
GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[xz_Mailings_GetMailingByID]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [xz_Mailings_GetMailingByID]
GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[xz_Mailings_GetMailings]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [xz_Mailings_GetMailings]
GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[xz_Mailings_InsertMailing]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [xz_Mailings_InsertMailing]
GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[xz_Mailings_UpdateMailing]') AND OBJECTPROPERTY(id,N'IsProcedure') = 1)
DROP PROCEDURE [xz_Mailings_UpdateMailing]
GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[FK_xz_Mailings_aspnet_Applications]') AND type = 'F')
ALTER TABLE [xz_Mailings] DROP CONSTRAINT [FK_xz_Mailings_aspnet_Applications]
GO

IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[xz_Mailings]') AND OBJECTPROPERTY(id, N'IsUserTable') = 1)
DROP TABLE [xz_Mailings]